#override("css")
<link href="#springUrl('/static/css/plugins/bootstrap-table/bootstrap-table.min.css')" rel="stylesheet">
#end

#override("body")
<body class="gray-bg">
<div class="row  border-bottom white-bg dashboard-header">
	<div class="row">
		<div class="col-sm-12">
			<table id="dataTable"></table>
		</div>
	</div>
</div>
</body>
#end
#override("js")
<script src="#springUrl('/static/js/plugins/bootstrap-table/bootstrap-table.min.js')"></script>
<script src="#springUrl('/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js')"></script>
<script src="#springUrl('/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js')"></script>
<script src="#springUrl('/static/plugins/layer-v2.2/layer/layer.js')"></script>
<script src="#springUrl('/static/js/bank/base_list.js')"></script>
<script type="text/javascript">
	var dataUrl = "#springUrl('/sys/sysLog/listJson')";
	var dataColumns = [{
		field: 'id',
		title: '序号'
	}, {
		field: 'uid',
		title: '用户ID'
	}, {
		field: 'content',
		title: '日志内容'
	}, {
		field: 'operation',
		title: '用户操作'
	}, {
		field: 'createDate',
		title: '创建时间',
		formatter: function (value, row, index) {
			return formatDate(row.createDate);
		}
	}, {
		title: '操作',
		formatter: function (value, row, index) {
			var id = row.id;
			return '<a class="btn btn-xs btn-danger" onclick="del(' + "'" + id + "'" + ')"><i class="fa fa-remove"></i>删除</a>';
		}
	}];

	function dataQueryParams(params) {
		return {
			_size: params.limit, 			// 页面大小
			_index: params.offset 			// 页码
		};
	}

	$('#searchId').click(function() {
		refreshTable();
	});

	function refreshTable() {
		$('#dataTable').bootstrapTable('refresh');
	}

	function del(logId) {
		//询问框
		layer.confirm('确定删除吗？', {
			btn: ['确定', '取消'] //按钮
		}, function () {
			$.ajax({
				type: "POST",
				url: "#springUrl('/sys/sysLog/delete/')" + logId,
				datatype: "text",
				success: function (data) {
					if (data == 'true') {
						$('#dataTable').bootstrapTable('refresh', {url: dataUrl});
						layer.alert('删除成功', {icon: 1}, function (index) {
							layer.closeAll();
						});
					} else {
						layer.alert('删除失败', {icon: 2}, function (index) {
							layer.closeAll();
						});
					}
				}
			});
		}, function () {
			return;
		});
	}
</script>
#end
#extends("/common/base.html")
